package com.stark.wechat.message.in;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.stark.wechat.core.Event;
import com.stark.wechat.core.MessageType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * 上报地理位置事件
 *
 * @author <a href="mailto:mengbin@hotmail.com">Ben</a>
 * @version 1.0.0
 * @see <a href="https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html#%E4%B8%8A%E6%8A%A5%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BA%8B%E4%BB%B6">能力接入 / 基础消息与订阅通知 / 接收事件推送 / 上报地理位置事件</a>
 * @since 2024/5/27
 */
@Data
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class LocationEventMessage implements EventMessage {

    private static final long serialVersionUID = 6933355273040661323L;

    /**
     * 开发者微信号
     */
    @JacksonXmlProperty(localName = "ToUserName")
    private String toUserName;

    /**
     * 发送方账号（一个OpenID）
     */
    @JacksonXmlProperty(localName = "FromUserName")
    private String fromUserName;

    /**
     * 消息创建时间
     */
    @JacksonXmlProperty(localName = "CreateTime")
    private Long createTime;

    /**
     * 消息类型，event
     */
    @JacksonXmlProperty(localName = "MsgType")
    private MessageType msgType;

    /**
     * 事件类型，LOCATION
     */
    @JacksonXmlProperty(localName = "Event")
    private Event event;

    /**
     * 地理位置纬度
     */
    @JacksonXmlProperty(localName = "Latitude")
    private BigDecimal latitude;

    /**
     * 地理位置经度
     */
    @JacksonXmlProperty(localName = "Longitude")
    private BigDecimal longitude;

    /**
     * 地理位置精度
     */
    @JacksonXmlProperty(localName = "Precision")
    private BigDecimal Precision;

}
